#ifndef __MSHELL_H
#define __MSHELL_H
#include "sys.h"

// up = 1b 5b 41
// down = 1b 5b 42
#define CTRLA       (0x01)
#define CTRLX       (0x18)
#define CTRLC       (0x03)
#define CTRLZ       (0x1A)
#define TABLE       (0x09)
#define BACK        ('\b')

typedef struct
{
    const char *name;
    void (*func)(char *str);
    const char *help;
}shell_table, *shell_table_t;

extern int mshell_set_table(shell_table_t table, uint32_t table_sz);
extern void mshell_set_password(char *pwd);
extern int mshell_password_verify(uint32_t delay);
extern void mshell_handle(void);
extern void mshell_init(void *dev);
extern void *mshell_dev(void);
extern int mshell_printf(const char *cmd_expr, ...);

#endif
